New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(puppeteer): export esm modules in package.json #7964
Conversation
I get the following error if I try to use ESM version for a NodeJS package:
The code for the test module is:
|
@OrKoN What's the filename of this test module? It either needs to have the |
@mathiasbynens it has type=module in package.json |
7ec1103
to
4b43cf9
Compare
e0ff1dc
to
35e934b
Compare
Signed-off-by: Randolf Jung <jrandolf@chromium.org>
a75262c
to
ae6ad1f
Compare
242452f
to
67a4486
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! nice work on the compatibility layer!
Nice work! Should we add some documentation to the |
I didn't investigate further, but the The relative path from '13.2' seems to work |
@my-lalex Since you are using webpack, I assume you have everything output to a single file. Could you compare the output with the previous output? Specifically the area where |
I kinda find the same as in the code source.... maybe using the Another point is that if all the code is bundled (including puppetteer's) - let's say for offline environment- there's no 'package.json' anymore.... wouldn't it be a good idea to store the version number in a global variable and use it after that? |
I am not sure what you mean by "offline environment". The code in |
When saying "offline environment", I'm talking about a computer having no internet connection. When this is that kind of target, you cannot use "npm install" to get your packages before running. So you (can) bundle all your code in a single file as in Node file size is less important.... and this way you just have one file to deploy, getting rid of all the My bad about A global variable, updated by the building process (or manually), would then be a good solution... for my part, I think that parsing a file (which might not be there) each time you need the package version isn't an optimal solution... And if this has to be the solution by deciding that puppeteer cannot be bundled, the use of let puppeteerPath = path.join(__dirname, "node_modules", "puppeteer");
// Just to be sure, depends on the environment
try {
puppeteerPath = path.dirname(require.resolve('puppeteer'));
} catch (e) {} |
Fixes #6753